<?php
namespace common\models;

use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;

/**
 * 交易评价表模型
 * @author ZCY
 */
class AROrderEvaluate extends ActiveRecord
{
    /**
     * @inheritdoc
     */
      
    const STATUS_NEED=1;            //待评价
    const STATUS_COMPLETE=2;        //已评价
    
    const IDENTITY_DEMAND=1;     //需求方
    const IDENTITY_APPLY=2;      //供应方
    const IDENTITY_BROKER=3;     //经纪人
    
    const RATING_BAD=60;       //差评
    const RATING_MEDIUM=80;    //中评
    const RATING_GOOD=100;     //好评
    
    
    
    public static function tableName()
    {
        return '{{%order_evaluate}}';
    }
    
    
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
        ];
    }
    
    /**
     * 获取用户信息
     */
    public function getUser()
    {
        return $this->hasOne(ARUser::className(), ['id' => 'uid']);
    }
    
    /**
     * 获取对方用户信息
     */
    public function getOppUser()
    {
        return $this->hasOne(ARUser::className(), ['id' => 'opp_uid']);
    }
  

}
